<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <!-- 等待输入完成后才通知绑定的值发生改变 -->
        <label for="lazyid">
            <input type="text" name="username" id="lazyid" v-model.lazy="username"> {{username}}
        </label>
        <br>
        <!-- 等待输入完成后才通知绑定的值发生改变 -->
        <label for="trim">
            <input type="text" name="username" id="trim" v-model.trim="username"> {{username}}
        </label>
        <br>
        <!-- .number 绑定的数值始终为数字类型 -->
        <label for="age">
            <input type="number" name="age" id="age" v-model.number="age"> {{age}}
        </label>
    </div>
    <script src="./js/vue.js"></script>
    <script>
        const app = new Vue({
            el: "#app",
            data: {
              username: "",
              age: 0
            }
        })
    </script>
</body>

</html>